package com.cuzz.springmvc.plugin.simpleexcel.configuration;

import com.cuzz.springmvc.plugin.simpleexcel.ExcelExportReturnHandler;
import com.cuzz.springmvc.plugin.simpleexcel.ExcelHandlerAdapter;
import com.cuzz.springmvc.plugin.simpleexcel.ExcelHandlerMapping;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;

@Configuration
public class SimpleExcelConfig {


    @Bean
    public ExcelHandlerMapping excelHandlerMapping() {
        ExcelHandlerMapping excelHandlerMapping = new ExcelHandlerMapping();
        excelHandlerMapping.setOrder(Ordered.HIGHEST_PRECEDENCE);
        return excelHandlerMapping;
    }
    @Bean
    public ExcelExportReturnHandler excelExportReturnHandler(){
        return new ExcelExportReturnHandler();
    }

    @Bean
    public ExcelHandlerAdapter excelHandlerAdapter() {
        return new ExcelHandlerAdapter();
    }
}
